/**
 * 
 */
package com.maywide.jdp.system.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <b>登录Service</b><br>
 * 
 * @author luoyang
 * @version 1.0
 * @since JDK1.6
 */
@Controller
public class LogoutServiceImpl implements LogoutService {
	private static final String LOGIN_PAGE = "loginPage";

	@RequestMapping(value = "/logout.json")
	public void logout(HttpServletRequest request,
			HttpServletResponse response, HttpSession session) throws Exception {
		session.invalidate();
		String loginPage = request.getSession().getServletContext().getInitParameter(LOGIN_PAGE);
		response.sendRedirect(loginPage);
	}

}
